import React from 'react'
import {
    Navigate
} from "react-router-dom"

function HocLogin(Com) {
    return (props) =>{
        const token = window.localStorage.getItem("token")
        if (!token) {
            return <Navigate to={"/no_permissions"}/>
        }return <Com {...props}/>
      
    }
}

export default HocLogin
